package com.juneng.utils;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021002154641052";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC49Ja+SuLOOAyB3AZld3TlUoogh29W9p2girKqhj+QHR9vutej9lG6zKYr8PtRD1AEMNwrScys3JWMZ00fEHXaSeawG9SBqKlUr6JXVe/Fa43TEyWIrQ3mKMqvbzE5PkKpQkPGG3zmZaovOUBjplQGVcIy/zfgODKbkmygTgZ8g/h0GfGop9XQ+RgC1vRWddkmTXMSTBvaK4G+q2Xypa3WR5KzwS7R5hisNEACw2a+0jYFpAIEs6CQ/kOx306obbuaRtAW4euGC88atBvYSH2goX3hRg92KEo+keZvYiBF7giH7xlh7yC+gYXsNbQpaE6KUILGxXz+RQTYBVb3PGOrAgMBAAECggEAKDLg4JMeIHwGG+NacIs6GO2Ln+5PwLLxJ4d9tZpgDk6GGp6dZ8GNmfAI3dwOg1u0pHSKJc5wcdGvn0iEdo/5TWxqezRRR60EwKc7vYesCViLBqlOqxoRv0h2ZRLhu/NQQcFpQZGP3/OQvZrP59iqwoW5I6Rc3JraRP3aJi1PM5iMlu+JJP8v8ssVqflDOEf3ZeXzxW6eVPHv8PxYrLSZFHRtWHJ9BulwU/W6O9/HyoTFWA1RBH6UVuarL7rDSgKaX4+z5qJMkvXoY/5nrWqGo3Zomv2bvjMvkBU5frd9lOhg9esLKY7jjh2zsvWWyfIss491iIzuRk3RPHoLWaQ/YQKBgQDmJ7LV31KoO3Y3tkGF4maBK94Mzts1wHKqdR4qBNQl74bMt8ea1eLbot9p+g1BPmX3QPpH3TddkQgjy96KmLeFPSf6RCMi1Jf/1Q1r49pmvKtitFgO5F+Olb9AeoHcCN8ZINIu9tXDZZfeyTik654mX2jm1FkNCfrs/kkybBO/tQKBgQDNuYeHijUZIbbFwLSJ0NADsJR28/WvCmeW5K9aGpVBSVvhJJiAC7ZUcoqR/1Rh2Q2RkhOaDwzRPk7Mm1iiCyYQ8S0mqEpojcAYtZr5pSrxeNOZB5Q8Bp/eLgVNY6QEdwnMIqx1371TViiGIJfOnuVIoXLEtVhB4vZZhEVP07Px3wKBgD1QKBlH1CpTJOw0loIHTU1uFUqONOG98g4tAysofCfbBqs07mz2O+hNHH2MCsntyJY07jgE28IGaAe5QQDlLEbHgwXt7vpRbmjOJjQu0Dj8XCAAcVEOT9KZXAjeWgf3KQ/1qWivg0T5pJrKOlfdGRWZ50VPHqYVmY5XM8LF/gDdAoGAIdbOsEDPkx60jbqw96pdTP4Sra5bTzuK5osfPNb6jg6fCl2WqBlFGIbuvC0fmCi3zqYUi1bGaPSyyX0UCzOCQ28oWh98fc4zNt1IbJ/6fFW/mIBipa0BRu6S+LPXGtTpy6Y4b/spjTey2r0pu1bvqA7GbgzWQ6AtnXPgYs0T4EkCgYEA2nrCPYkY9OllzgWKech5/OFitN92Dx6feoZ76WKo8hBx6bXpLB/+T1c3M9sIktfEUUjRl61vJGTOq4lD1cg08Koe+ithSuyLA/iT+FWHlS8chnngKJjfd/sAiyk8BveHi+XCPWQHNzTIDZTACJ6hCerNAF3IOvg/rgUm9+JYrfg=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgZdnbpJhfIjhD13MQTQscSvdmUJfWz6mo6b9wmsO9M9PtaQxXD+pBVUDaWvmmxgjw8B66+buLTMGD/bYskiikgQTm4ghoNKJQDcrMtg98yf6XtidpEgouXQ93ucF5CrE6bHYwUnYjBX9iFTNd1MEVR/v18AhAkDOXgFtWnwtuZ8YA6/6pDjqbjDA2jlaLcrWQG+Q+I8tSImbrNPXOAV+5+su+dqplfBBuceYuPG83YgG1aeFAX+CUrtcIACFyr+9JhEDtKdJi2Wu1xI/xF8UvLgs6q3KKeQk97X9IgH+5vGNM1DPQjxZ0KjE7q8xaNZf05WLnX3FTna30YTS48wYhwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "你的异步通知页面";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "你的回调页面";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";

    //支付宝回调地址 测试
    public static String NOTIFY_URL =
            "http://www.liuludushu.com:8081/pay/aliReturnPay";
    //支付宝回调地址 线上
    //  public static String NOTIFY_URL="http://app.hyyiqixiu.com/pay/aliReturnPay";
    //测试
    //  public static String NOTIFY_URL="http://localhost:8004/pay/aliReturnPay";
    //public static String NOTIFY_URL="http://47.110.86.72:8004/pay/aliSectionReturnPay";

    //支付宝课程支付回调地址
    // public static String NOTIFY_section_URL="http://47.110.86.72:8004/pay/aliSectionReturnPay";

    //购买vip金额
    // public static String totalFee = "365";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}